export function get(url, data={}) {
	return new Promise((resolve, reject) => {
		console.log('url-222222222',url)
		uni.request({
			data,
			url,
			success: (res) => {
				console.log('res', res)
				if (res.data.code == 0) {
					resolve(res.data)
				} else {
					uni.hideLoading()
					uni.showModal({
						content: res.data.message,
						showCancel: false,
					})
				}
			}
		})
	})
}

export function mihayoGet(url, data={}) {
	return new Promise((resolve, reject) => {
		uni.request({
			data,
			url,
			success: (res) => {
				console.log('res', res)
				if (res.data.retcode == 0) {
					resolve(res.data)
				} else {
					uni.hideLoading()
					uni.showModal({
						content: res.data.message,
						showCancel: false,
					})
				}
			}
		})
	})
}

export function post(url, data={}) {
	return new Promise((resolve, reject) => {
		uni.request({
			data,
			url,
			method: "POST",
			success: (res) => {
				console.log('res', res)
				if (res.data.code == 0) {
					resolve(res.data)
				} else {
					uni.hideLoading()
					uni.showModal({
						content: res.data.message,
						showCancel: false,
					})
				}
			}
		})
	})
}